//
//  NSDictionary+GQAdd.m
//  GQCategorys
//
//  Created by 走出趣_甄冠卿 on 2018/8/15.
//  Copyright © 2018年 zhenguanqing. All rights reserved.
//

#import "NSDictionary+GQAdd.h"

@implementation NSDictionary (GQAdd)

- (NSString *)convertToJsonString {
    NSError *error = nil;
    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self options:NSJSONWritingPrettyPrinted error:&error];
    if ([jsonData length] > 0 && error == nil){
        NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
        return jsonString;
    }else{
        return nil;
    }
}
@end
